#include "ChatRoomErr.h"

using std::string;
string ChatRoomErr_to_string(const ChatRoomErr& err){
    switch (err){
        case ChatRoomErr::SUCCESS:
            return "成功";
        case ChatRoomErr::NO_SUCH_CHAT_ROOM:
            return "不存在该聊天室";
        case ChatRoomErr::FILE_NOT_FOUND:
            return "文件不存在";
        case ChatRoomErr::FILE_OPEN_FAILED:
            return "文件打开失败";
        case ChatRoomErr::NO_SUCH_USER:
            return "用户不在该聊天室";
        case ChatRoomErr::ALLREADY_IN_ROOM:
            return "已经在聊天室中";
        default:
            return "未知错误";
    }
}